//
//  XHNetworkTool.m
//  围脖
//
//  Created by 魏兴浩 on 15/12/15.
//  Copyright © 2015年 wxh. All rights reserved.
//

#import "XHNetworkTool.h"
@interface XHNetworkTool()
@property (nonatomic,strong)NSString *client_id;
@property (nonatomic,strong)NSString *client_secret;
@end
@implementation XHNetworkTool
#pragma mark -网络单例
+(instancetype)sharedManager{
    static id instance;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken,^{
        instance = [[self alloc]init];
    });
    return instance;
}


#pragma mark -授权登录
-(NSURL *)loginAuthorizeUrl{
    //测试授权
    self.client_id = @"2515073634";
    self.client_secret = @"0db15f4b2719f423bc05541bcf056db4";
    self.redirect_uri = @"https://www.baidu.com/";
    //拼接地址
    NSString *urlString = [NSString stringWithFormat:@"https://api.weibo.com/oauth2/authorize?client_id=%@&redirect_uri=%@",self.client_id,self.redirect_uri];
    //授权地址
    NSURL *url = [NSURL URLWithString:urlString];
    //放回授权地址
    return url;
}
@end
